import 'package:flutter/material.dart';
import '../utils/yq_colors.dart';

class TimeRangeDisplay extends StatelessWidget {
  final DateTime startTime;
  final DateTime endTime;

  const TimeRangeDisplay({
    Key? key,
    required this.startTime,
    required this.endTime,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.end,
      children: [
        Text(
          'TO',
          style: TextStyle(
            fontSize: 14,
            color: YQColors.primary,
            fontWeight: FontWeight.w500,
          ),
        ),
        const SizedBox(width: 4),
        Column(
          crossAxisAlignment: CrossAxisAlignment.end,
          mainAxisSize: MainAxisSize.min,
          children: [
            Text(
              _formatDateTime(startTime),
              style: TextStyle(
                fontSize: 14,
                color: YQColors.secondary,
                height: 1.2,
              ),
            ),
            Text(
              _formatDateTime(endTime),
              style: TextStyle(
                fontSize: 14,
                color: YQColors.secondary,
                height: 1.2,
              ),
            ),
          ],
        ),
      ],
    );
  }

  String _formatDateTime(DateTime dateTime) {
    return '${dateTime.year}年${dateTime.month}月${dateTime.day}日 ${dateTime.hour.toString().padLeft(2, '0')}:00';
  }
} 